//
// Created by dddgzc on 2025/1/24.
//

#ifndef CAMERA_H
#define CAMERA_H
#include "MyTimer.h"
#include "Vector2.h"


class Camera {
public:
    Camera();
    ~Camera() = default;

    const Vector2& getPosition() const;
    void reset();
    void onUpdate(int delta);

    /**
     *
     * @param strength 抖动强度
     * @param duration 抖动持续时间
     */
    void shake(float strength, float duration);
private:
    Vector2 position;
    MyTimer shakeTimer; // 抖动结束定时器
    bool isShaking = false; // 是否正在抖动
    float shakingStrength = 0.0f; // 抖动幅度
};


#endif //CAMERA_H
